Image processing method, image processing apparatus, and electronic camera

ABSTRACT

An image processing method of the present invention includes a detection step detecting a characteristic area from each of three or more shot images having a common graphic pattern in part thereof, the characteristic area having an image significantly different from the other shot images, and a combining step extracting a partial image located in the characteristic area from each of the three or more shot images and combining these partial images into one image.

CROSS REFERENCE TO RELATED APPLICATION

This application is based upon and claims the benefit of priority from Japanese Patent Application No. 2007-034912, filed on Feb. 15, 2007, the entire contents of which is incorporated herein by reference.

BACKGROUND

1. Field

The present invention relates to an image processing method for image combining, an image processing apparatus provided with an image combining function, and an electronic camera provided with an image combining function.

2. Description of the Related Art

Patent reference 1 (Japanese Unexamined Patent Application Publication No. 2001-28726) discloses an electronic camera provided with an image combining function. The principle of the function is additive average combining of multiple shot images obtained by, for example, continuous shooting. Shooting continuously a moving object (dynamic body) using a tripod and image-combining the obtained multiple shot images allow a still background and a trajectory of the dynamic body to be included in one image.

It should be noted that this image combining does not discriminate the dynamic body from the background and the background is also included in the dynamic body area, and thereby the dynamic body appears to be transparent. To perform combining to make a dynamic body opaque (hereinafter, called “opaque combining”), it is necessary to detect a presence area of dynamic body from each of the shot images and to connect the areas.

However, it is difficult to detect a presence area of dynamic body automatically, and therefore it is currently difficult to realize automatic opaque combining.

SUMMARY

The present invention provides an image processing method capable of performing opaque combining of shot images without fail. The present invention further provides an image processing apparatus and an electronic camera capable of performing opaque combining of shot images without fail.

An image processing method of the present invention includes a detecting step detecting a characteristic area from each of three or more shot images having a common graphic pattern in part thereof, the characteristic area having an image significantly different from the other shot images, and a combining step extracting a partial image located in the characteristic area from each of the three or more shot images and combining these partial images into one image.

Here, the detecting step preferably assumes, in each of the three or more shot images, an area which has an image significantly different from an averaged image of the other shot images as the characteristic area.

Also, the detecting step preferably generates a distribution map of the characteristic area detected from each of the three or more shot images, and the combining step preferably performs the extraction according to the distribution map.

Also, the detecting step preferably performs filter processing on the distribution map for smoothing distribution boundaries.

Also, the combining step may perform weighted average on the partial image extracted from each of the three or more shot images and partial images extracted from the same areas in the other shot images.

Also, the combining step may set a weight of the weighted averaging to be a value specified by a user.

Also, the detecting step preferably performs the detection, instead of using the three or more shot images, using reduced-size versions thereof.

Further, an image processing apparatus of the present invention includes a detecting unit that detects a characteristic area from each of three or more shot images, the characteristic area having an image significantly different from the other shot images, and a combining unit that extracts a partial image located in the characteristic area from each of the three or more shot images and combines these partial images into one image.

Also, the detecting unit preferably assumes, in each of the three or more shot images, an area which has an image significantly different from an averaged image of the other shot images as the characteristic area.

Also, the detecting unit preferably generates a distribution map of the characteristic area detected from each of the three or more shot images and the combining unit preferably performs the extraction according to the distribution map.

Also, the detecting unit preferably performs filter processing on the distribution map for smoothing distribution boundaries.

Also, the combining unit may perform weighted average on the partial image extracted from each of the three or more shot images and partial images extracted from the same areas in the other shot images.

Also, the combining unit may set a weight of the weighted averaging to be a value specified by a user.

Also, the detecting unit preferably performs the detection, instead of using the three or more shot images, using reduced-size versions thereof.

Further, an electronic camera of the present invention includes an imaging unit that shoots an object to obtain a shot image and any one of the image processing apparatus of the present invention to process three or more shot images obtained by the imaging unit.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram illustrating a configuration of an electronic camera;

FIG. 2 is a diagram illustrating examples of shot images specified by a user;

FIG. 3 is an operational flowchart of a combine-processing part 17A;

FIG. 4 is a diagram illustrating generating steps of an index image (up to difference image calculation);

FIG. 5 is a diagram illustrating generating steps of an index image (up to index image calculation);

FIG. 6 is a diagram illustrating an index image Y_(index);

FIG. 7 is a diagram illustrating a true index image I_(index);

FIG. 8 is a diagram illustrating the true index image I_(index) after filter processing;

FIG. 9 is a diagram illustrating a combining method based on the true index image I_(index) (in an opacity of 1); and

FIG. 10 is a diagram illustrating a combining method based on the true index image I_(index) (in an arbitrary opacity).

DETAILED DESCRIPTION OF THE EMBODIMENTS

Hereinafter, an embodiment of the present invention will be described. The present embodiment is an embodiment for an electronic camera.

First, a configuration of an electronic camera will be described.

FIG. 1 is a diagram illustrating the configuration of the electronic camera. As shown in FIG. 1, an electronic camera 10 includes a shooting lens 11, an imaging sensor 12, an A/D converter 13, a signal processing circuit 14, a timing generator (TG) 15, a buffer memory 16, a CPU 17, an image processing circuit 18, a displaying circuit 22, a rear monitor 23, a card interface (card I/F) 24, an operating button 25, etc., and a card memory 24A is attached to the card interface 24. Among these, the CPU 17 is capable of performing image-combine processing (to be described below). In the following description, it is assumed that a combine-processing part 17A performing the image-combine processing is included in the CPU 17.

The CPU 17 is connected to the buffer memory 16, the image processing circuit 18, the displaying circuit 22, and the card interface 24 via a bus 19. The CPU 17 sends image data to the image processing circuit 18 by use of the bus 19 and thereby performs normal image processing on a shot image such as pixel interpolation processing and color conversion processing. Also, the CPU 17 sends the image data to the rear monitor 23 via the displaying circuit 22, and thereby displays various images on the rear monitor 23. Further, the CPU 17 writes an image file into the card memory 24A and reads the image file out of the card memory 24A via the card interface 24.

Further, the CPU 17 is connected to the timing generator 15 and the operating button 25. The CPU 17 drives the imaging sensor 12, the A/D converter 13, the signal processing circuit 14, etc. via the timing generator 15, and also recognizes various indications such as mode switching provided by a user via the operating button 25.

Hereinafter, the electronic camera 10 is assumed to have a shooting mode, an editing mode, and the like.

Next, operation of the CPU 17 in the shooting mode will be described.

When the electronic camera 10 is set to be in the shooting mode, the user enters a shooting indication into the CPU 17 by manipulating the operating button 25. The shooting indications include a single shooting indication and a continuous shooting indication, and the CPU 17 discriminates the both indications based on a push-down period length of the operating button 25, and the like.

When the single shooting indication is entered, the CPU 17 drives the imaging sensor 12, the A/D converter 13 and the signal processing circuit 14 once, and obtains an image signal (image data) for one frame of a shot image. The obtained image data is stored in the buffer memory 16.

At this time, the CPU 17 sends the image data of the shot image stored in the buffer memory 16 to the image processing circuit 18 and performs the normal image processing on the shot image, and also generates an image file of the processed shot image to write the image file into the card memory 24A. Thereby the single shooting is completed. Here, the image file has an image storing area and a tag area, and the image data of the shot image is written in the image storing area and information accompanying the shot image is written in the tag area. The accompanying information includes a reduced-size version of image data of a shot image (image data of a thumbnail image).

On the other hand, when the continuous shooting indication is entered, the CPU 17 continuously drives the imaging sensor 12, the A/D converter 13, and the signal processing circuit 14 multiple times, and obtains an image signal (image data) for multiple frames of shot images. The obtained image data is stored in the buffer memory 16.

At this time, the CPU 17 sends the image data of the shot images stored in the buffer memory 16 to the image processing circuit 18 and performs the normal image processing on the shot image, and also generates an image file of the processed shot image to write the image file into the card memory 24A. After this operation has been performed for multiple frames of the shot images, the continuous shooting is completed. Here, each of the image files has an image storing area and a tag area, and the image data of the shot image is written in the image storing area and information accompanying the shot image is written in the tag area. The accompanying information includes a reduced-size version of image data of a shot image (image data of a thumbnail image).

Next, operation of the CPU 17 in the editing mode will be described.

When the electronic camera 10 is set to be in the editing mode, the CPU 17 displays a menu of the editing mode on the rear monitor 23. One of the menu items is “image combining”. This image combining is an image combining capable of the opaque combining.

While the menu is displayed, the user manipulates the operating button 25 to specify a desired item of the menu to the CPU 17. When the user specifies “image combining”, the CPU 17 reads out the image files in the card memory 24A, and sends the image data of the thumbnail images added to the image files to the displaying circuit 22. Thereby, shot images previously obtained are reproduced and displayed on the rear monitor 23. In this reproducing display, a plurality of shot images is preferably displayed in parallel at the same time on the rear monitor 23 so that the user can compare a plurality of the shot images to one another.

While the shot images are reproduced and displayed, the user manipulates the operating button 25 to specify to the CPU 17 desired N shot images I_(k) (k=1, 2, . . . , N) among the shot images reproduced and displayed. Then, the user manipulates the operating button 25 to specify an opacity α_(k) (k=1, 2, . . . , N) of a dynamic body included in each of the specified N shot images I_(k) (k=1, 2, . . . , N). The opacity α_(k) is an opacity of a dynamic body M_(k) included in the shot image I_(k).

Here, the N shot images I_(k) (k=1, 2, . . . , N) specified by the user have a part common to one another (background) except for a dynamic bodies M_(k) (k=1, 2, . . . , N) as shown in FIG. 2. Such shot images I_(k) (k=1, 2, . . . , N) are obtained under common shooting conditions (shooting sensitivity, shutter speed, aperture value, and framing).

In the present embodiment, these N shot images I_(k) (k=1, 2, . . . , N) need not include a shot image in which the dynamic body M_(k) is not present, but, instead, the number of shot images N is required to be three or more.

Also, pixel coordinates of the dynamic bodies M_(k) (k=1, 2, . . . , N) included in each of the shot images I_(k) (k=1, 2, . . . , N) preferably do not overlap with one another. This is because image combining calculation in the present embodiment assumes that pixel coordinates do no overlap.

Also, a range of an opacity α_(k) (k=1, 2, . . . , N) which a user can specify is 0≦α_(k)≦1. For example, for the opaque combining, the user only needs to specify the opacity α_(k) as α₁=α₂=α₃= . . . =α_(N)=1, and for erasing all the dynamic bodies from a combined image, specify the opacity α_(k) as α₁=α₂=α₂= . . . =α_(N)=0.

When the opacity α_(k) is specified as above, the CPU. 17 sends image data of the specified N shot images I_(k) (k=1, 2, . . . , N) to the combine-processing part 17A and performs image-combine processing on the shot images. The CPU 17 obtains one combined image by this image-combine processing, and then displays the combined image on the rear monitor 23. The CPU 17 also newly generates an image file of the combined image and writes the image file into the memory card 24A.

Next, operation of the combine-processing part 17A will be described in detail. For simplicity of the description, specified shot images are assumed to be three shot images I₁, I₂, and I₃ shown in FIG. 2. In this case, the number of shot images N is three. Also, each shot image I_(k) is assumed to have a Y component, a Cb component, and a Cr component.

Accordingly, in the description, the Y component of a shot image I_(k) is denoted by Y_(k), the Cb component of a shot image I_(k) is denoted by Cb_(k), and the Cr component of a shot image I_(k) is denoted by Cr_(k). Also in the description, a pixel value of an arbitrary image X at a pixel coordinates (i, j) is denoted by X(i, j) and the origin of the pixel coordinates (i, j) is determined to be at upper left corner of an image.

FIG. 3 is an operational flowchart of the combine-processing part 17A. Each step thereof will be described in sequence as follows.

(Steps S1 to S3)

The combine-processing part 17A performs size reduction processing on each of the shot images I₁, I₂, and I₃ in order to improve processing speed of the image-combine processing. For achieving a size reduction ratio of 16, the size reduction processing is performed using the following formulas, for example.

$\begin{matrix} {{{Y_{k}\left( {i,j} \right)} = {\left( {\sum\limits_{y = 4}^{{4j} + 3}{\sum\limits_{{jx} = {4i}}^{{4i} + 3}{Y_{k}\left( {x,y} \right)}}} \right)/16}}{{{Cb}_{k}\left( {i,j} \right)} = {\left( {\sum\limits_{y = 4}^{{4j} + 3}{\sum\limits_{{jx} = {4i}}^{{4i} + 3}{{Cb}_{k}\left( {x,y} \right)}}} \right)/16}}{{{Cr}_{k}\left( {i,j} \right)} = {\left( {\sum\limits_{y = 4}^{{4j} + 3}{\sum\limits_{{jx} = {4i}}^{{4i} + 3}{{Cr}_{k}\left( {x,y} \right)}}} \right)/16}}} & \left( {{Formula}\mspace{20mu} 1} \right) \end{matrix}$

(Step S4)

The combine-processing part 17A generates an average image I_(ave) of the shot images I₁, I₂, and I₃ after the size reduction processing. Y_(ave): the Y component of the average image I_(ave), Cb_(ave): the Cb component of the average image I_(ave), and Cr_(ave): the Cr component of the average image I_(ave), are calculated by the following formulas.

$\begin{matrix} {{{Y_{ave}\left( {i,j} \right)} = {\left( {\sum\limits_{k = 1}^{N}{Y_{k}\left( {i,j} \right)}} \right)/N}}{{{Cb}_{ave}\left( {i,j} \right)} = {\left( {\sum\limits_{k = 1}^{N}{{Cb}_{k}\left( {i,j} \right)}} \right)/N}}{{{Cr}_{ave}\left( {i,j} \right)} = {\left( {\sum\limits_{k = 1}^{N}{{Cr}_{k}\left( {i,j} \right)}} \right)/N}}} & \left( {{Formula}\mspace{20mu} 2} \right) \end{matrix}$

(Step S5)

The combine-processing part 17A generates an index image Y_(index) of the Y component, an index image Cb_(index) of the Cb component, and an index image Cr_(index) of the Cr component as provisional index images, respectively. Representing these index images, a generation step of the index image Y_(index) will be described.

First, the combine-processing part 17A focuses on the shot image 11 as shown in FIG. 4, and calculates a difference image ΔY₁ between the Y component image Y₁ of the focused shot image I₁ and an average image of the Y components Y₂ and Y₃ of the other shot images I₂ and I₃.

Similarly, the combine-processing part 17A focuses on the shot image I₂, and calculates a difference image ΔY₂ between the Y component image Y₂ of the focused shot image I₂ and an average image of the Y components Y₁ and Y₃ of the other shot images I₁ and I₃.

Similarly, the combine-processing part 17A focuses on the shot image I₃, and calculates a difference image ΔY₃ between the Y component image Y₃ of the focused shot image I₃ and an average image of the Y components Y₁ and Y₂ of the other shot images I₁ and I₂.

Thereby, the difference image ΔY₁ regarding the shot image I₁, the difference image ΔY₂ regarding the shot image I₂, and the difference image ΔY₃ regarding the shot image I₃ are obtained. Here, the difference images ΔY₁, ΔY₂, and ΔY₃ are calculated using the following formula.

ΔY _(k)(i, j)=|(Y _(ave)(i, j)×N−Y _(k)(i, j))/(N−1)−Y_(k)(i, j)|  (Formula 3)

In this formula, “k” is an image number of a focused shot image, and (Y_(ave)×N−Y_(k))/(N−1) is the average image of the other shot images.

Subsequently, the combine-processing part 17A compares the difference images ΔY₁, ΔY₂, and ΔY₃ for every pixel coordinates as shown in FIG. 5.

Then, the combine-processing part 17A determines an area as a characteristic area A₁, the area being in the difference image ΔY₁ and whose pixel value is larger than the pixel values of the same areas in the other difference images ΔY₂, and ΔY₃. This characteristic area A₁ is an area having an outstanding pixel value in the shot image I₁ compared with the other shot images I₂ and I₃. Therefore, this characteristic area A₁ can be assumed to be a presence area of a dynamic body M₁.

Also, the combine-processing part 17A determines an area as a characteristic area A₂, the area being in the difference image ΔY₂ and whose pixel value is larger than the pixel values of the same areas in the other difference images ΔY₁, and ΔY₃. This characteristic area A₂ is an area having an outstanding pixel value in the shot image I₂ compared with the other shot images I₁ and I₃. Therefore, this characteristic area A₂ can be assumed to be a presence area of a dynamic body M₂.

Also, the combine-processing part 17A determines an area as a characteristic area A₃, the area being in the difference image ΔY₃ and whose pixel value is larger than the pixel values of the same areas in the other difference images ΔY₁, and ΔY₂. This characteristic area A₃ is an area having an outstanding pixel value in the shot image I₃ compared with the other shot images I₁ and I₂. Therefore, this characteristic area A₃ can be assumed to be a presence area of a dynamic body M₃.

Then, the combine-processing part 17A generates one index image Y_(index) as a distribution map of these characteristic areas A₁, A₂, and A₃.

The characteristic area A₁ in this index image Y_(index) is provided with a pixel value “1” as same as the image number of the shot image I₁ and the dynamic body M₁, the characteristic area A₂ in the index image Y_(index) is provided with a pixel value “2” as same as the image number of the shot image I₂ and the dynamic body M₂, and the characteristic area A₃ in the index image Y_(index) is provided with a pixel value “3” as same as the image number of the shot image I₃ and the dynamic body M₃.

Such an index image Y_(index) is calculated by use of the following formula.

Y _(index)(i, j)=k·of·max[ΔY ₁(i, j), . . . , ΔY _(N)(i, j)]  (Formula 4)

In this formula, k·of·max[x₁, x₂, . . . , x_(N)] is an element number k of the largest element x_(k) among N elements x₁, x₂, . . . , x_(N).

FIG. 6 is a diagram illustrating the index image Y_(index). As shown in FIG. 6, in the index image Y_(index), many pixels located in the presence area of the dynamic body M₁ (refer to FIG. 2) have a pixel value “1”, many pixels located in the presence area of the dynamic body M₂ (refer to FIG. 2) have a pixel value “2”, and many pixels located in the presence area of the dynamic body M₃ (refer to FIG. 2) have a pixel value “3”. Meanwhile, in the other areas in the index image Y_(index), a pixel having a pixel value “1”, a pixel having a pixel value “2”, and a pixel having a pixel value “3” are mixed.

Therefore, a distribution relationship among the dynamic bodies M₁, M₂, and M₃ (refer to FIG. 2) is reflected to the index image Y_(index) with a certain accuracy. Using this index image Y_(index) enables the dynamic bodies M₁, M₂, and M₃ to be extracted from the shot images I₁, I₂, and I₃, respectively.

However, in this index image Y_(index) there exists an indefinite portion such as a portion enclosed by a dotted line in FIG. 6. The reason is probably that the luminance of a part of the dynamic body M₃ (refer to FIG. 2) is close to the luminance of the background and false detection occurred so that this part was determined to be the characteristic area A₁ or the characteristics area A₂, rather than determined to be the characteristic area A₃.

Accordingly, the combine-processing part 17A in the present step performs the following processing when detecting the characteristic areas A₁, A₂, and A₃ in the calculation of the index image Y_(index) (refer to FIG. 5).

That is, the combine-processing part 17A compares pixel values in the characteristic area A₁ of the difference image ΔY₁, the characteristic area A₂ of the difference image ΔY₂, and the characteristic area A₃ of the difference image ΔY₃ with a threshold value thY, and assumes an area having pixel value smaller than the threshold value thY to be a particular area A₀ which does not belong to any of the characteristic areas A₁, A₂, and A₃. Then, the combine-processing part 17A assigns the particular area A₀ of the index image Y_(index) with a particular value except for “1”, “2”, and “3” (hereinafter, “0”). This particular value is replaced with an appropriate value in the next step.

In the present step, the index image Cb_(index) of the Cb component and the index image Cr_(index) of the Cr component are also generated, and this is performed for the purpose of this replacement.

Here, the index image Cb_(index) is calculated by use of the following formulas.

ΔCb _(k)(i, j)=|(Cb _(ave)(i, j)×N−Cb _(k)(i, j))/(N−1)−Cb _(k)(i, j)|

Cb _(index)(i, j)=k·of·max[ΔCb ₁(i, j), . . . , ΔCb _(N)(i, j)]  (Formula 5)

Also, when calculating this index image Cb_(index), the combine-processing part 17A performs the following processing.

That is, the combine-processing part 17A compares pixel values in a characteristic area A₁ of a difference image ΔCb₁, a characteristic area A₂ of a difference image ΔCb₂, and a characteristic area A₃ of a difference image ΔCb₃ with a threshold value thCb, and assumes an area having a pixel value smaller than the threshold value thCb to be a particular area A₀ which does not belong to any of the characteristic areas A₁, A₂, and A₃. Then the combine-processing part 17A assigns the particular area A₀ in the index image Cb_(index) with a particular value except for “1”, “2”, and “3” (hereinafter, “0”).

Also, the index image Cr_(index) is calculated by use of the following formulas.

ΔCr _(k)(i, j)=|(Cr _(ave)(i, j)×N−Cr _(k)(i, j))/(N−1)−Cr _(k)(i, j)|

C _(index)(i, j)=k·of·max[ΔCr ₁(i, j), . . . , ΔCr _(N)(i, j)]  (Formula 6)

Also, when calculating this index image Cr_(index), the combine-processing part 17A performs the following processing.

That is, the combine-processing part 17A compares pixel values in a characteristic area A₁ of a difference image ΔCr₁, a characteristic area A₂ of a difference image ΔCr₂, and a characteristic area A₃ of a difference image ΔCr₃ with a threshold value thCr, and assumes an area having a pixel value smaller than the threshold value thCr to be a particular area A₀ which does not belong to any of the characteristic areas A₁, A₂, and A₃. Then the combine-processing part 17A assigns the particular area A₀ in the index image Cr_(index) with a particular value except for “1”, “2”, and “3” (hereinafter, “0”).

(Step S6)

The combine processing part 17A determines whether a pixel having the particular value “0” exists in the index image Y_(index), and, if it exists, replaces the pixel value with a pixel value at the same pixel coordinates in the index image Cb_(index).

Further, the combine-processing part 17A determines whether a pixel having the particular value “0” remains in the index image Y_(index) after the replacement, and if it remains, replaces the pixel value with a pixel value at the same coordinates in the index image Cr_(index). The index image Y_(index) after these replacements is determined to be a true index image I_(index) (refer to FIG. 7).

Accordingly, in the present step, indefiniteness of the index image Y_(index) is compensated by the other index images Cb_(index) and Cr_(index), and the more definite true index image I_(index) is obtained.

Therefore, even if the luminance of a part of a dynamic body M_(k) included in a certain shot image I_(k) is close to the luminance of a background thereof, the true index image I_(index) is compensated to become more definite as long as the color of the part is different from the color of the background.

Here, even in the true index image I_(index) after the compensation, there still remains a possibility that a pixel having a particular value “0” exists. This is because there can exist a part of the dynamic body which is similar to the background thereof in both luminance and color.

(Step S7)

The combine-processing part 17A performs filter processing on the true index image I_(index). A filter used at this time is a filter smoothing boundary lines of the characteristic areas A1, A2, and A3, and, for example, a majority filter of 3×3 pixels. The majority filter has a function to replace a pixel value of a focused pixel with a mode value of pixel values of peripheral pixels thereof.

Here, when the mode value becomes the particular value “0” during this filter processing, the combine-processing part 17A replaces the pixel value of the focused pixel with a second mode value, not the mode value. This replacement eliminates a pixel having the particular value “0” from the true index image I_(index).

The filter processing on the true index image I_(index) may be performed once, but preferably performed appropriate number of times of two or more. As the filter processing is repeated, pixels having the same pixel value (each of the characteristic areas A₁, A₂, and A₃) on the true index image I_(index) gather together gradually. Therefore, in the true index image I_(index) after the filter processing, the characteristic area A₁ covers the entire presence area of the dynamic body M₁ (refer to FIG. 2), the characteristic area A₂ covers the entire presence area of the dynamic body M₂ (refer to FIG. 2), and the characteristic area A₃ covers the entire presence area of the dynamic body M₃ (refer to FIG. 2), as shown in FIG. 8.

In such a true index image I_(index), boundary lines between the characteristic areas A₁, A₂, and A₃ are not always located at a boundary area between the background and the dynamic body M₁, a boundary area between the background and the dynamic body M₂, or a boundary area between the background and the dynamic body M₃, but located definitely in a boundary area between the dynamic body M₁ and the dynamic body M₂, a boundary area between the dynamic body M₂ and the dynamic body M₃, and a boundary area between the dynamic body M₁ and the dynamic body M₃. Here, in the present step, instead of increase in the number of executions of the filter processing, a filter diameter for the filter processing may be increased.

(Step S8)

The combine-processing part 17A performs size enlargement processing on the true index image I_(index) after the filter processing, and makes a size thereof as same as that of the original shot images I₁, I₂, and I₃. If the size reduction ratio in the steps S1 to S3 described hereinabove is 16, the size enlargement processing uses, for example, the following formulas, where a true index image after the enlargement processing is denoted by I′_(index). In fact, the size enlargement processing using the following formulas is a padding processing.

$\begin{matrix} {{{I_{index}^{\prime}\left( {{4j},{4i}} \right)} = {I_{index}\left( {i,j} \right)}}{{I_{index}^{\prime}\left( {{4j},{{4i} + 1}} \right)} = {I_{index}\left( {i,j} \right)}}{{I_{index}^{\prime}\left( {{4j},{{4i} + 2}} \right)} = {I_{index}\left( {i,j} \right)}}{{I_{index}^{\prime}\left( {{4j},{{4i} + 3}} \right)} = {I_{index}\left( {i,j} \right)}}{{I_{index}^{\prime}\left( {{{4j} + 1},{4i}} \right)} = {I_{index}\left( {i,j} \right)}}{{I_{index}^{\prime}\left( {{{4j} + 1},{{4i} + 1}} \right)} = {I_{index}\left( {i,j} \right)}}\vdots {{I_{index}^{\prime}\left( {{{4j} + 3},{{4i} + 3}} \right)} = {I_{index}\left( {i,j} \right)}}} & \left( {{Formula}\mspace{20mu} 7} \right) \end{matrix}$

Here, the true index image after the enlargement processing I′_(index) is used in the next step as a source map for extracting a partial image from each of the shot images I₁, I₂, and I₃.

For this purpose, a pixel value in the true index image I′_(index) should be anyone of “1”, “2”, and “3” and should not be an intermediate value among “1”, “2”, and “3”. Therefore, in the size enlargement processing in the present step, an average interpolation should not be applied, and, if interpolation is applied, it should be a majority interpolation.

(Step S9)

The combine-processing part 17A, on the basis of the true index image I′_(index), extracts a partial image I₁·A₁ located in the characteristic area A₁ from the shot image I₁, a partial image I₂·A₂ located in the characteristic area A₂from the shot image I₂, and a partial image I₃·A₃ located in the characteristic area A₃ from the shot image I₃, as shown in FIG. 9. Then, the combine-processing part 17A combines the three extracted partial images I₁·A₁, I₂·A₂, and I₃·A₃ to obtain one combined image I. Here, a partial image located in an area A of an image X is represented by X·A.

At this time, the combine-processing part 17A sets an opacity of the partial image I₁·A₁, an opacity of the partial image I₂·A₂, and an opacity of the partial image I₃·A₃ to be α₁, α₂, and α₃, respectively. These values α₁, α₂, and α₃ are the opacities specified by the user for the dynamic bodies M₁, M₂, and M₃ (refer to FIG. 2). This concept is illustrated as shown in FIG. 10.

That is, regarding the characteristic area A₁, weighted averaging is performed on the shot image I₁ and an average image (I₂+I₃)/2 of the other shot images I₂ and I₃. A weight ratio of the weighted averaging is set to be α₁:(1−α₁) according to the user's specification.

Focusing on this characteristic area A₁, there exists not only the dynamic body M₁ but also the background portion in the shot image I₁, but the graphic pattern of the background portion is as same as that of the average image {(I₂+I₃)/2} of the other shot images I₂ and I₃. Therefore, a graphic pattern of the characteristic area A₁ in the combined image I becomes the background on which the dynamic body M₁ is superimposed with an opacity of α₁.

Also, regarding the characteristic area A₂, weighted averaging is performed on the shot image I₂ and an average image (I₁+I₃)/2 of the other shot images I₁ and I₃. A weight ratio of the weighted averaging is set to be α₂:(1−α₂) according to the user's specification. Focusing on this characteristic area A₂, there exists not only the dynamic body M₂ but also the background portion in the shot image I₂, but the graphic pattern of the background portion is as same as that in the average image {(I₁+I₃)/2} of the other shot images I₁ and I₃.

Therefore, a graphic pattern of the characteristic area A₂ in the combined image I becomes the background on which the dynamic body M₂ is superimposed on with an opacity of α₂. Also, regarding the characteristic area A₃, weighted averaging is performed on the shot image I₃ and an average image (I₁+I₂)/2 of the other shot images I₁ and I₂. A weight ratio of the weighted averaging is set to be α₃:(1−α₃) according to the user's specification.

Focusing on this characteristic area A₃, there exists not only the dynamic body M₃ but also the background portion in the shot image I₃, but the graphic pattern of the background portion is as same as that in the average image {(I₁+I₂)/2} of the other shot images I₁ and I₂.

Therefore, a graphic pattern of the characteristic area A₃ in the combined image I becomes the background on which the dynamic body M₃ is superimposed with an opacity of α₃.

Here, the combining of the shot images I₁, I₂, and I₃ in the present step is performed for each component of the shot images I₁, I₂, and I₃, and the common true index image I′_(index) is used for the combining of each component. When a Y component of the combined image I is denoted by Y, a Cb component of the combined image I is denoted by Cb, and a Cr component of the combined image I is denoted by Cr, combining each component uses the following formulas.

k(i, j)=I′ _(index)(i, j)

Y(i, j) =α_(k(i, j)) ×Y _(k(i, j))(i, j)+(1−α_(k(i,j)))×(Y _(ave)(i, j)×N−Y _(k(i,j))(i, j))/(N −1)

Cb(i, j)=α_(k(i,j)) ×Cb _(k(i,j))(i, j)+(1−α_(k(i,j)))×(Cb _(ave)(i, j)×N−Cb _(k(i,j))(i, j))/(N−1)

Cr(i, j)=α_(k(i,j)) ×Cr _(k(i,j))(i, j)+(1−α_(k(i,j)))×(Cr _(ave)(i, j)×N−Cr _(k(i,j))(i, j))/(N−1)   (Formula 8)

That is, a pixel value Y (i, j) at a certain pixel coordinates (i, j) of the combined image I is determined to be a weighted-average of a pixel value Y₁ (i, j), Y₂ (i, j), and Y₃ (i, j) at the same pixel coordinates in the shot images I₁, I₂, and I₃ according to a pixel value I′_(index) (i, j) at the same pixel coordinates (i, j) in the true index image I′_(index). For example, when the pixel value I′_(index) (i, j) of the true index image I′_(index) is “1”, a weighted average of the pixel value Y₁ (i, j) and an average value of the Y₂ (i, j) and Y₃ (i, j) is calculated with a weight ratio of α₁:(1−α₁). Also, for example, when the pixel value I′_(index) (i, j) of the true index image I′_(index) is “2”, a weighted average of the pixel value Y₂ (i, j) and an average value of the Y₁ (i, j) and Y₃ (i, j) is calculated with a weight ratio of α₂:(1−α₂).

Similarly, a pixel value Cb(i, j) of a certain pixel of the combined image I is determined to be a weighted-average of a pixel value Cb₁ (i, j), Cb₂ (i, j), and Cb₃ (i, j) at the same pixel coordinates in the shot images I₁, I₂, and I₃ according to a pixel value I′_(index) (i, j) at the same pixel coordinates (i, j) in the true index image I′_(index). For example, when the pixel value I′_(index) (i, j) of the true index image I′_(index) is “1”, a weighted average of the pixel value Cb₁ (i, j) and an average value of the Cb₂ (i, j) and Cb₃ (i, j) is calculated with a weight ratio of α₁: (1−α₁). Also, for example, when the pixel value I′_(index) (i, j) of the true index image I′_(index) is “2”, a weighted average of the pixel value Cb₂ (i, j) and an average value of the Cb₁ (i, j) and Cb₃ (i, j) is calculated with a weight ratio of α₂:(1−α₂).

Similarly, a pixel value Cr(i, j) of a certain pixel of the combined image I is determined to be a weighted-average of a pixel value Cr₁ (i, j), Cr₂ (i, j), and Cr₃ (i, j) at the same pixel coordinates in the shot images I₁, I₂, and I₃ according to a pixel value I′_(index) (i, j) at the same pixel coordinates (i, j) in the true index image I′_(index). For example, when the pixel value I′_(index) (i, j) of the true index image I′_(index) is “1”, a weighted average of the pixel value Cr₁ (i, j) and an average value of the Cr₂ (i, j) and Cr₃ (i, j) is calculated with a weight ratio of α₁:(1−α₁). Also, for example, when the pixel value I′_(index) (i, j) of the true index image I′_(index) is “2”, a weighted average of the pixel value Cr₂ (i, j) and an average value of the Cr₁ (i, j) and Cr₃ (i, j) is calculated with a weight ratio of α₂:(1−α₂) (That is the description of the step S9.).

As a result, the combine-processing part 17A, while managing opacities of the dynamic bodies M1, M2, and M3 included in the shot images I₁, I₂, and I₃ to be α₁, α₂, and α₃ specified by the user, respectively, can combine these shot images I₁, I₂, and I₃ correctly. When the opacities are set to be “1”, the combining may become the opaque combining.

Here, while the user in the present embodiment specified the opacities of all the dynamic bodies, the opacities of some or all of the dynamic bodies may not be specified. In this case, the CPU 17 sets the opacity which is not specified to be a default value (e.g., “1”).

Also, although the combine-processing part 17A in the present embodiment eliminated the particular value “0” from the true index image I_(index) during the filtering processing (step S7), the processing associated with this elimination may be omitted. Note that, in this case, the combine-processing part 17A needs to replace the particular value “0” with a non-particular value (any one of “1”, “2”, and “3”) in the end of the step S7.

For example, the combine-processing part 17A replaces the particular value “0” with “1” when the shot image I₁ takes priority, the particular value “0” with “2” when the shot image I₂ takes priority, and the particular value “0” with “3” when the shot image I₃ takes priority. Here, which of the shot images I₁, I₂, and I₃ takes priority may be specified by the user in advance or determined automatically by the combine-processing part 17A through its evaluation of the shot images I₁, I₂, and I₃.

Also, while the combine-processing part 17A in the present embodiment performed the size reduction processing (steps S1 to S3) on the shot images to improve the processing speed in the image-combine processing, the size reduction processing (steps S1 to S3) may be omitted and, instead, the thumbnail image of the shot image (stored in the same image file as the shot image) may be used.

Also, while the combine-processing part 17A in the present embodiment performed the size reduction processing (steps S1 to S3) on the shot images to improve the processing speed in the image-combine processing, the size reduction processing (steps S1 to S3) may be omitted when a slow processing speed does not matter. In this case, the size enlargement processing (step S8) is also omitted.

Although, in the electronic camera 10 of the present embodiment, the whole image-combine processing was performed by the CPU 17, a part or whole of the image-combine processing may be performed by a dedicated circuit except for the CPU 17 or the image processing circuit 18.

Also, some or all of the functions of the image-combine processing in the electronic camera 10 of the present embodiment may be provided in the other apparatus having a user interface and a monitor such as an image storage or a printer.

Also, some or all of the functions of the image-combine processing in the electronic camera 10 of the present embodiment may be performed by a computer. When performed by a computer, a program for the purpose (image-combine processing program) is stored in a memory of the computer (hard disk drive or the like). Install of the image-combine processing program into the hard disk drive is performed, for example, via the Internet or a recording medium such as a CD-ROM.

The many features and advantages of the embodiments are apparent from the detailed specification and, thus, it is intended by the appended claims to cover all such features and advantages of the embodiments that fall within the true spirit and scope thereof. Further, since numerous modifications and changes will readily occur to those skilled in the art, it is not desired to limit the inventive embodiments to the exact construction and operation illustrated and described, and accordingly all suitable modifications and equivalents may be resorted to, falling within the scope thereof. 

1. An image processing method, comprising: a detecting step detecting a characteristic area from each of three or more shot images having a common graphic pattern in part thereof, said characteristic area having an image significantly different from the other shot images; and a combining step extracting a partial image located in said characteristic area from each of said three or more shot images and combining these partial images into one image.
 2. The image processing method according to claim 1, wherein said detecting step assumes, in each of said three or more shot images, an area which has an image significantly different from an averaged image of the other shot images as said characteristic area.
 3. The image processing method according to claim 1, wherein: said detecting step generates a distribution map of said characteristic area detected from each of said three or more shot images; and said combining step performs said extracting according to said distribution map.
 4. The image processing method according to claim 3, wherein said detecting step performs filter processing on said distribution map for smoothing distribution boundaries.
 5. The image processing method according to claim 1, wherein said combining step performs weighted average on the partial image extracted from each of said three or more shot images and partial images extracted from the same areas in the other shot images.
 6. The image processing method according to claim 5, wherein said combining step sets a weight of said weighted averaging to be a value specified by a user.
 7. The image processing method according to claim 1, wherein said detecting step performs said detecting, instead of using said three or more shot images, using reduced-size versions thereof.
 8. An image processing apparatus, comprising: a detecting unit detecting a characteristic area from each of three or more shot images, said characteristic area having an image significantly different from the other shot images; and a combining unit extracting a partial image located in said characteristic area from each of said three or more shot images and combines these partial images into one image.
 9. The image processing apparatus according to claim 8, wherein said detecting unit assumes, in each of said three or more shot images, an area which has an image significantly different from an averaged image of the other shot images as said characteristic area.
 10. The image processing apparatus according to claim 8, wherein: said detecting unit generates a distribution map of said characteristic area detected from each of said three or more shot images; and said combining unit performs said extracting according to said distribution map.
 11. The image processing apparatus according to claim 10, wherein said detecting unit performs filter processing on said distribution map for smoothing distribution boundaries.
 12. The image processing apparatus according to claim 8, wherein said combining unit performs weighted average on the partial image extracted from each of said three or more shot images and partial images extracted from the same areas in the other shot images.
 13. The image processing apparatus according to claim 12, wherein said combining unit sets a weight of said weighted averaging to be a value specified by a user.
 14. The image processing apparatus according to claim 8, wherein said detecting unit performs said detecting, instead of using said three or more shot images, using reduced-size versions thereof.
 15. An electronic camera, comprising: an imaging unit that shoots an object to obtain a shot image; and an image processing apparatus according to claim 8 that processes three or more shot images obtained by said imaging unit. 